<template>
  <view>
    <web-view :webview-styles="webviewStyles" :src="url"></web-view>
  </view>
</template>

<script>
import  shareJS from '../../utils/share';
export default {
  mixins:[shareJS],
  data() {
    return {
      url:'',
      webviewStyles: {
        progress: {
          color: '#FF3333'
        }
      }
    }
  },
  onNavigationBarButtonTap(e){

    console.log(e)
    if(e.index===0){
      this.$u.route({url:'/pages/tabBar/my',type:'tab'})
    }else{

      const text =  this.$t('WoShop商城系统');
      this.shareLink = text+this.url;
      this.shareTit = 'WoShop';
      this.shareText = text
      // #ifdef APP-PLUS
      const actionbuttons=[{title:this.$t('微信')},{title:this.$t('朋友圈')},{title:this.$t('复制链接')},{title:this.$t('其他')}];
      const actionstyle={title:this.$t('请选择分享'),cancel:this.$t('取消'),buttons:actionbuttons};
      plus.nativeUI.actionSheet(actionstyle,e=>{
        if(e.index===1){
          this.shareWebLink('weixin','WXSceneSession')
        }else if(e.index===2){
          this.shareWebLink('weixin','WXSenceTimeline')
        }else if(e.index===3){
          this.copyShareLink()
        }else{
          this.otherShare()
        }

      })
      // #endif
    }

}
}
</script>

<style scoped>

</style>
